package com.heihei.mymusic.util;

import java.io.IOException;
import java.io.RandomAccessFile;

/**
  *    db文件相关工具类
  *
  */
public class DbUtils {

    /**
      *  方法描述:
      *
      */
    public static void encodeDb(String filePath) throws IOException {
        RandomAccessFile randomAccessFile=new RandomAccessFile(filePath,"rws");
        int length = 106;
        byte[] b = new byte[length];
        randomAccessFile.read(b, 0, length);
        for (int i = 0; i < length; i++) {
            b[i] = (byte) (Byte.MAX_VALUE-Byte.MIN_VALUE - b[i]);
        }
        randomAccessFile.seek(0);
        randomAccessFile.write(b, 0,length);
        randomAccessFile.close();
    }
}
